<template>
    <div class="cover" :style="{ width: width + 'px', height: width + 'px' }">
        <el-image :style="{ width: width + 'px', height: width + 'px' }"
            :src="cover ? proxy.globalInfo.imageUrl + cover : localCover" fit="scale-down" loading="lazy"></el-image>
    </div>
</template>

<script setup>
import { getCurrentInstance } from 'vue';
const { proxy } = getCurrentInstance();
const props = defineProps({
    cover: {
        type: String
    },
    width: {
        type: Number,
        default: 60
    }
})

const localCover = new URL("@/assets/default_avatar.png", import.meta.url).href
</script>

<style lang="scss" scoped>
.cover {
    background: #ddd;
    border-radius: 5px;
}
</style>
